package hfdp.chp07.chp0702;

public class HomeTheaterFacade {

	private Amplifier amplifier;
	private Tuner tuner;
	private DvdPlayer dvdPlayer;
	private CdPlayer cdPlayer;
	private Projector project;
	private TheaterLights theaterLights;
	private Screen screen;
	private PopcornPopper popcornPopper;
	private Light light;
	
	public HomeTheaterFacade(Amplifier amplifier, Tuner tuner, DvdPlayer dvdPlayer, CdPlayer cdPlayer,
			Projector project, TheaterLights theaterLights, Screen screen, PopcornPopper popcornPopper,Light light) {
		this.amplifier = amplifier;
		this.tuner = tuner;
		this.dvdPlayer = dvdPlayer;
		this.cdPlayer = cdPlayer;
		this.project = project;
		this.theaterLights = theaterLights;
		this.screen = screen;
		this.popcornPopper = popcornPopper;
		this.light = light;
	}
	
	public void watchMovie(String movie) {
		System.out.println("Get ready to watch a movie...");
		popcornPopper.on();
		popcornPopper.pop();
		light.dim(10);
		screen.down();
		project.on();
		project.wideScreenMode();
		amplifier.on();
		amplifier.setDvd();
		amplifier.setSurroundSound();
		amplifier.setVolume(5);
		dvdPlayer.on();
		dvdPlayer.play(movie);
	}
	
	public void endMovie() {
		System.out.println("Shutting movie theater down...");
		popcornPopper.off();
		light.on();
		screen.up();
		project.off();
		amplifier.off();
		dvdPlayer.stop();
		dvdPlayer.eject();
		dvdPlayer.off();
	}
	
}
